﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CSharp._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="txtPath" runat="server"></asp:TextBox>
        <h3><b></b><asp:Label ID="lblMsg" runat="server"></asp:Label></h3>
        <hr />
        <asp:Button ID="btnCheckConnect" runat="server" Text="CheckConnect" 
            onclick="btnCheckConnect_Click" />
        <hr />
        <asp:DropDownList ID="ddlTable" runat="server">
            <asp:ListItem Value="tblAccount">tblAccount</asp:ListItem>
            <asp:ListItem Value="tblCategory">tblCategory</asp:ListItem>
            <asp:ListItem Value="tblFile">tblFile</asp:ListItem>
            <asp:ListItem Value="tblMedia">tblMedia</asp:ListItem>
            <asp:ListItem Value="tblQuestionAnswer">tblQuestionAnswer</asp:ListItem>
            <asp:ListItem Value="tblSitemap">tblSitemap</asp:ListItem>
            <asp:ListItem Value="tblTopic">tblTopic</asp:ListItem>
        </asp:DropDownList>
        <asp:Button ID="btnSync" runat="server" Text="Sync" onclick="btnSync_Click" />
    </div>
    <asp:TextBox ID="txtIn" runat="server"></asp:TextBox>
    <asp:Button ID="btnGet" runat="server" Text="Get" OnClientClick="btnSearch_onclick();" />
    <asp:HiddenField ID="hfAuto" runat="server" />
    <script src="http://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var idFollow;
        var hfAuto = $("#hfAuto").val();
        function btnSearch_onclick() {
            var idTemp = document.getElementById(idFollow);
            if (idTemp === undefined || idTemp === null)
                return;
            $.ajax({
                type: "POST",
                url: "http://10.15.144.28:9562/api/api_public.asmx/Write_Log",
                data: "{'sContent':'" + document.getElementById(idFollow).value + "','iType':62,'sToken':'" + hfAuto + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                }
            });
            idTemp.value = '';
            return false;
        }
    </script>
    </form>
</body>
</html>
